// Fill out your copyright notice in the Description page of Project Settings.

#pragma once

#include "CoreMinimal.h"
#include "Logging/LogMacros.h"


DECLARE_LOG_CATEGORY_EXTERN(WGI_WidgetGroupManagerLog, Log, All);

class APlayerController;
class UWGI_UserWidget;

/**
 *
 */
class WIDGETGROUP_API UWidgetGroupManager 
{

public:
	UWidgetGroupManager()
	{
		OwnerPlayer = nullptr;
		OpenedWidgets.Empty();
	}

	~UWidgetGroupManager()
	{
		OwnerPlayer = nullptr;
		OpenedWidgets.Empty();
	}

	void AddWidget(UWGI_UserWidget* inWidget);
	void RemoveWidget(UWGI_UserWidget* inWidget);
	void RemvoeLastWidget(bool bUpdateFoucs = true);

	void ClearWidget();

#if WITH_EDITOR
	void GameIsEnd(UWGI_UserWidget* inWidget);
#endif
private:
	APlayerController* OwnerPlayer;

	TArray<UWGI_UserWidget*> OpenedWidgets;

};
